<?php
/**
 * Class bootstrap utama
 * @author simukti <me@simukti.net>
 */


class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    /**
     * _initConfig() ini harus dilakukan sebelum init yang lain
     */
    protected function _initConfig()
    {
        Zend_Registry::set('config', new Zend_Config($this->getOptions()));
    }
    
    /**
     * inisialisasi zona waktu dari file config
     */
    protected function _initTimezone()
    {
        date_default_timezone_set(Zend_Registry::get('config')->site
                                                              ->settings
                                                              ->application
                                                              ->timezone
        );
    }
    
    /**
    * 
    */
    protected function _initResponse()
    {
        $this->bootstrap('frontController');
        
        $response = new Zend_Controller_Response_Http();

        $response->setHeader('language', 'en')
                 ->setHeader('content-language', 'en')
                 ->setHeader('Content-Type', 'text/html; charset=utf-8');
        
        $this->getPluginResource('frontController')->getFrontController()
                                                   ->setResponse($response);
                                                   
        return $response;
    }
    
    protected function _initMeta()
    {
        $front = Zend_Controller_Front::getInstance();
        $front->registerPlugin(new Kemuning_View_Helper_Metagenerator());
    }
    
    
    protected function _initView()
    {
        $view = new Zend_View();
        $view->headTitle()->setSeparator(' - ');
        // test
        $view->headTitle(ucwords('judul post ada disini'));
    }
    
}

